package google.code.asoap.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target (ElementType.FIELD)  
@Retention (RetentionPolicy.RUNTIME)  
/**
 * Marker annotation for defining classes that can be deserialized from a SOAPObject
 * @author bruno.silva
 */
public @interface SOAPProperty {
	/**
	 * Define types of fields; this elects the logic of deserialization applied to such field.
	 * @author bruno.silva 
	 */
	public static enum Type {
		/** For primitive types. Wrapper classes and String included. */
		Primitive,
		/** For primitive type arrays. Array of Wrapper classes and String included. Currently, only supports byte[]. */
		PrimitiveArray, 
		/** For complex types. Causes the parser to be called recursively for such field. Complex types must also be annotated. */
		Complex,
		/** For complex array types. Causes the parser to be called recursively for each array item. Complex types must also be annotated. */
		ComplexArray
	};
		
	/**	The SOAP property identifier. */
    String name() default "";
    
    /**
     * Either Type.Primitive, Type.PrimitiveArray, Type.Complex. 
     * @see SOAPProperty#Type 
     */
    Type type() default Type.Primitive;
}  

